package com.example.attempt.service.impl;

import com.example.attempt.entity.Comment;
import com.example.attempt.mapper.CommentMapper;
import com.example.attempt.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    CommentMapper commentMapper;
    @Override
    public List<Comment> queryAll(){
        return commentMapper.queryAll();
    }

    @Override
    public List<Comment> queryBySid(String sid){
        return commentMapper.queryBySid(sid);
    }

    @Override
    public List<Comment> queryByTid(String tid){
        return commentMapper.queryByTid(tid);
    }

    @Override
    public List<Comment> queryByAid(String aid){
        return commentMapper.queryByAid(aid);
    }

    @Override
    public Comment queryByCommentId(int commentId){
        return commentMapper.queryByCommentId(commentId);
    }

    @Override
    public List<Comment> queryByPid(int pid){
        return commentMapper.queryByPid(pid);
    }

    @Override
    public int addComment(Comment comment){
        commentMapper.addComment(comment);
        return 0;
    }

    @Override
    public int deleteComment(int commentId){
        commentMapper.deleteComment(commentId);
        return 0;
    }
}
